import java.util.Scanner;

public class TwoDimensionalArray_HomeWork01 {
    public static void main(String[] args) {
        //1、使用二维数组存储班上五个学生三门功课的考试成绩，
        // 要求输出每一个学生的总分、平均分、最高分、最低分
        Scanner input = new Scanner(System.in);
        int[][] scores = new int[5][3];
        int sum, max, min;
        max = min = 0;
        double avg = 0;
        for (int i = 0; i < scores.length; i++) {
            sum = 0;
            System.out.println("-----------------分割线-----------------");
            for (int j = 0; j < scores[i].length; j++) {
                System.out.print("请输入第" + (i + 1) + "个同学第" + (j + 1) + "门课的成绩:");
                int score = input.nextInt();
                scores[i][j] = score;
                sum += score;
                max = min = scores[i][0];
                if (max < scores[i][j]) {
                    max = scores[i][j];
                }
                if (min > scores[i][j]) {
                    min = scores[i][j];
                }
            }
            avg = (double) sum / 3;
            System.out.println("第" + (i + 1) + "个学生的总分为:" + sum+" "+"平均分为:" + avg+" "+"最高分为:" + max+" "+"最低分为:" + min);
        }
    }
}
